package com.jshop.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;



public class AdminInterceptor implements Interceptor {
	public void intercept(Invocation ai) {
		Controller controller = ai.getController();
		controller.setAttr("base", controller.getRequest().getContextPath());
		controller.setAttr("ctrname",controller.getRequest().getContextPath()+ai.getControllerKey());
		if(ai.getActionKey().contains("/list")){
			controller.setAttr("actionkey",ai.getControllerKey());
		}
		String uuid=ai.getControllerKey().replaceAll("/", "_");
		controller.setAttr("uuid", uuid);
		ai.invoke();
	}

}
